<?php 
namespace app\admin\model;
use think\Model;

class NewsClassify extends Model
{
	public function selnc()
	{
		return $this->where('level','<',3)->select();
	}
	public function cou()
	{
		return $this->select()->count();
	}
	public function selparid()
	{
		return $this->field('parentid')->select();
	}
	public function sellev1()
	{
		return $this->where('level',1)->select();
	}
	public function sellev2()
	{
		return $this->where('level',2)->select();
	}
	public function addnc($arr)
	{
		return $this->insert($arr);
	}
	public function delnc($id)
	{
		return $this->where('id','in',$id)->delete();
	}
	public function sel($id)
	{
		return $this->where('id',$id)->select();
	}
	public function updnc($id,$arr)
	{
		return $this->where('id',$id)->update($arr);
	}
}